package com.psp.web.persist.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.psp.web.model.ServiceCategoryBean;
import com.psp.web.model.vo.ServiceCategoryLevelVO;
import com.psp.web.persist.dao.ServiceCategoryDao;

@Repository
public class ServiceCategoryImpl extends BaseImpl implements ServiceCategoryDao {

	final String NAME_SPACE = NAME_SPACE_HEADER + ".ServiceCategoryMapper";

	@Override
	public List<ServiceCategoryBean> selectAllList() {
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectAllList");
	}

	@Override
	public ServiceCategoryBean selectById(String cid) {
		return sqlSessionTemplate.selectOne(NAME_SPACE + ".selectById", cid);
	}

	@Override
	public List<String> selectChildTypesByPcode(Integer firstType) {
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectChildTypesByPcode", firstType);
	}

	@Override
	public List<ServiceCategoryBean> selectTypesByPcode(int pcode) {
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectTypesByPcode", pcode);
	}

	@Override
	public ServiceCategoryBean selectByCode(Integer cateCode) {
		return sqlSessionTemplate.selectOne(NAME_SPACE + ".selectByCode", cateCode);
	}

	@Override
	public List<ServiceCategoryBean> selectListInLevel(int level) {
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectListInLevel", level);
	}

	@Override
	public List<ServiceCategoryLevelVO> selectLevel1AllByCode(Integer code) {
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectLevel1AllByCode", code);
	}

	@Override
	public List<ServiceCategoryBean> selectAllTypes2Menu() {
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectAllTypes2Menu");
	}

}
